<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>get 请求</title>
</head>
<body>
<div id="app">

</div>

<script src="../../../../js/axios.js"></script>
<script type="module">
    import {createApp, onMounted} from "../../../../js/vue.esm-browser.js";

    let app = createApp({
        setup() {
            /*function getRequest() {
                axios.get("https://www.httpbin.org/get?name=abcque&age=18&gender=M")
                    .then(function (response) {
                        console.log(typeof response);
                        console.log(response);
                    })
            }*/

            /*function getRequest() {
                axios.get(
                    "https://www.httpbin.org/get",
                    {
                        params: {
                            name: "abcque",
                            age: 18,
                            gender: "M",
                        }
                    }
                )
                    .then(function (response) {
                        console.log(typeof response);
                        console.log(response);
                    })

            }*/

            async function getRequest() {
                let response = await axios.get(
                    "https://www.httpbin.org/get",
                    {
                        params: {
                            name: "abcque",
                            age: 18,
                            gender: "M",
                        }
                    }
                );

                console.log(response);
            }

            onMounted(
                () => {
                    getRequest()
                }
            )

            return {}
        }
    })

    app.mount("#app")
</script>
</body>
</html>